#ifndef QTTEST_HANDLER_H
#define QTTEST_HANDLER_H

#include "./Looper.h"
#include "./Message.h"

class Handler {
public:
    Handler();

    explicit Handler(Looper *looper);

    virtual ~Handler() = default;

    void setLooper(Looper *looper);

    virtual void handleMessage(Message *msg) {}

    void sendMessage(Message *msg);

    void sendEmptyMessage(int what);

    void post(MessageCallback callback);

private:
    Looper *mLooper;
};

#endif //QTTEST_HANDLER_H

